/*
 * Copyright (C) 2006-2015
 * 版权所有者为北京捷越联合信息咨询有限公司。本系统是商用软件,未经授权擅自复制或传播本程序的部分或全部将是非法的。
 * @title: OverdueFilter.java
 * @package com.jy.modules.cims.plan
 * @author zhaox
 * @date 2015-3-5 下午2:38:12
 * @version v1.00
 * @description: TODO(用一句话描述该文件做什么)
 */

package com.jy.modules.cims.component.creditRight.plan;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import com.jy.modules.cims.data.dto.credit.PlanChangeDTO;

/**
 * 逾期
 * 
 * @classname: OverdueFilter
 * @description: TODO(这里用一句话描述这个类的作用)
 */
@Service("com.jy.modules.cims.component.creditRight.plan.PlanOverdueFilter")
public class PlanOverdueFilter implements PlanFilter {

    @Autowired
    @Qualifier("com.jy.modules.cims.component.creditRight.plan.DealModeChain")
    private DealModeChain dealModeChain;

    /* (非 Javadoc)
    * <p>title: doFilter</p>
    * <p>description: </p>
    * @param object
    * @see com.jy.modules.cims.plan.PlanFilter#doFilter(java.lang.Object)
    */

    @Override
    public void doFilter(int index, PlanChangeDTO planChangeDTO, PlanFilterChain planFilterChain) {
        if (CreditPlanConstant.CHANGE_TYPE_OVERDUE.equals(planChangeDTO.getChangeType())) {
            dealModeChain.doFilter(0, planChangeDTO, dealModeChain);
        } else {
            index++;
            planFilterChain.doFilter(index, planChangeDTO, planFilterChain);
        }

    }

}
